<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vuejs-2.5.16.js"></script>
    <script src="js/axios-0.18.0.js"></script>
    <!--&lt;!&ndash; 引入element ui样式 &ndash;&gt;-->
    <!--<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">-->
    <!--&lt;!&ndash; 引入 element ui组件库 &ndash;&gt;-->
    <!--<script src="https://unpkg.com/element-ui/lib/index.js"></script>-->
</head>
<body>

<div id="app">

               <form>
                     用户名<input type="text" v-model="formdata.username"><br>
                     密码<input type="password" v-model="formdata.password"><br>
                     性别
                   <input type="radio" value="male" v-model="formdata.sex">男
                   <input type="radio" value="female" v-model="formdata.sex">女
                   <br>
                     爱好
                   <input type="checkbox" value="洗澡" v-model="formdata.hobby">洗澡
                   <input type="checkbox" value="看电视" v-model="formdata.hobby">看电视
                   <input type="checkbox" value="睡觉" v-model="formdata.hobby">睡觉
                   <br>
                     学历
                    <select v-model="formdata.education">
                        <option value="初中">初中</option>
                        <option value="高中">高中</option>
                        <option value="大专">大专</option>
                        <option value="本科">本科</option>
                    </select>
                   <br>
                   简介<textarea rows="5" cols="20" v-model="formdata.remark"></textarea>
                   <br>
                   <input type="button" @click="add" value="提交"></input><br>
               </form>

</div>
    <script>
         var  vm = new Vue({

             el:"#app",
             data:{
                //  表单数据模型对象
                //  formdata:{
                //      username:'',
                //      password:'',
                //      sex:'',
                //      hobby:[],
                //      education:'',
                //      remark:''
                //  }
                 formdata:{}

             },
             methods:{
                 add(){
                     // {key:value}  @RequestBody
                     axios.post("/user.do",this.formdata).then((res)=>{
                         alert(res)
                     })
                 }
             }
         })

    </script>

</body>
</html>